package com.hsc.www.exchangeType.direct1;

import com.hsc.www.User;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class UserSender {
    @Autowired
    private RabbitTemplate  template;


    @Autowired 
    public void send11(RabbitTemplate template) {
        template.getExchange();


    }

    public void send(User user) {
        template.convertAndSend(Config.QUEUE_NAME, user);
        System.out.println("发送：" + user.toString());
    }
}